package cn.zwx.common.rocket.producer.service;

import cn.zwx.common.rocket.consumer.bo.ConsumerListenerBO;

import javax.annotation.PostConstruct;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public interface DefaultConsumerService {


    Map<String,DefaultConsumerService> consumerMap = new ConcurrentHashMap<>(8);

    @PostConstruct
    default void  init(){
        consumerMap.put(getTopic(),this);
    }

    /**
     * 消息类型
     * @return String
     */
    String getTopic();

    /**
     * 处理消息业务类
     * @return String
     */
    String process(ConsumerListenerBO bo);
}
